package sctu.edu.java.year2016.team04.baiyunfei.day20160525.chapter6_1;

/**判断mingrikejijavabu中i出现的次数
 * Created by DE on 2016/5/25.
 */
public class Chapter6_1 {
    public static void main(String[] args) {
        int i_num=0;
String a=new String("mingrikejijavabu");
        while(a.indexOf("i")!=-1) {
            if (a.indexOf("i") != -1) {
                i_num++;
                a = a.replaceFirst("i", "x");
            }

        }
        System.out.println(+i_num);
    }

}
